package org.leetcodeplus.leetcodeplus.generator;
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;


/**
 * Author: Vivienne
 */
public class CodeGenerator {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/leetcode?remarks=true&useInformationSchema=true", "root", "hjy20050927")
                .globalConfig(builder -> builder
                        .author("Baomidou")
                        .outputDir("D:\\IdeaProjects\\LeetCodePlus\\src\\main\\java\\org\\leetcodeplus\\leetcodeplus")
                        .commentDate("yyyy-MM-dd")
                )
                .packageConfig(builder -> builder
                        .parent("api")
                        .entity("entity")
                        .mapper("mapper")
                        .service("service")
                        .serviceImpl("service.impl")
                        .xml("mapper.xml")
                )
                .strategyConfig(builder -> builder
                        .entityBuilder()
                        .enableLombok()
                )
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}
